<template>
  <div>
    <div class="topbar">
      <div class="city-entry">深圳</div>
      <div class="switch-hot-default">
        <a href="javascrip:;" class="hot-item"> <h2>热映</h2> </a
        ><a href="javascrip:;" class="hot-item"> <h2>影院</h2> </a
        ><a href="javascrip:;" class="hot-item"> <h2>待映</h2> </a
        ><a href="javascrip:;" class="hot-item">
          <h2>经典电影</h2>
        </a>
      </div>
      <a href="javascrip:;" class="search"
        ><span class="iconfont icon-sousuo"></span
      ></a>
    </div>
    <div>
      <div class="cinema">
        <div class="tab">
          <div class="item">
            全城<span class="iconfont icon-xiala"></span
            ><span class="iconfont icon-vertical_line"></span>
          </div>
          <div class="item">
            品牌<span class="iconfont icon-xiala"></span
            ><span class="iconfont icon-vertical_line"></span>
          </div>
          <div class="item">特色<span class="iconfont icon-xiala"></span></div>
        </div>
      </div>
      <div class="cinema-list">
        <a
          href="javascrip:;"
          class="item mb-line-b link"
          v-for="item in cinema"
          :key="item.id"
        >
          <div class="cinema-item">
            <div class="title line-ellipsis">
              <span>{{ item.nm }}</span>
              <span class="price-block">
                <span class="price">{{ item.sellPrice }}</span>
                <span class="q">元起</span>
              </span>
            </div>
            <div class="location">
              {{ item.addr }}
            </div>
            <div class="label">
              <div class="allowRefund" v-if="item.tag.allowRefund == '1'">
                退
              </div>
              <div class="endorse" v-if="item.tag.endorse == '1'">改签</div>
              <div class="snack" v-if="item.tag.snack == '1'">小吃</div>
              <div class="vipTag" v-if="item.tag.vipTag != ''">
                {{ item.tag.vipTag }}
              </div>（
              <div class="hallType" v-for="item in item.tag.hallType" :key="item.index">
                {{ item }}
              </div>
            </div>
            <div class="discount-block">
              <div class="card" v-show="item.promotion.cardPromotionTag != ''">
                <img src="../assets/card.png" />
              </div>
              <div class="discount-label-text">
                {{ item.promotion.cardPromotionTag }}
              </div>
            </div>
          </div>
        </a>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "MyCinema",
  props: ["cinema"],
};
</script>

<style scoped lang="less">
.topbar {
  display: flex;
  width: 100%;
  height: 0.8544rem;
  background: #fff;
  justify-content: space-between;
  border-bottom: 3px solid #f5f5f5;

  .city-entry {
    padding-left: 0.3rem;
    font-size: 0.3rem;
    color: #666;
    display: flex;
    align-items: center;
  }

  .switch-hot-default {
    display: flex;
    width: 4.6602rem;
    height: 0.88rem;
    line-height: 0.88rem;
    position: relative;
    justify-content: space-around;

    a {
      font-size: 0.3rem;
      height: 0.8544rem;
      color: #666;
      font-weight: 700;
      text-align: center;
      margin: 0 1.33333333vw;
      text-decoration: none;

      h2 {
        display: inline;
        font-size: 0.3rem;
        font-weight: 700;
      }
    }
  }

  .search {
    width: 0.4rem;
    height: 0.4rem;
    padding: 0.2rem 0.3rem 0.2rem 0.2rem;

    .icon-sousuo {
      font-size: 0.3883rem;
      color: #ef443a;
      font-weight: 700;
    }
  }
}
.cinema {
  position: relative;
  width: 100%;
  height: 0.8rem;
  z-index: 10;
  background-color: #fff;
  color: #777;

  .tab {
    display: flex;
    background: url(../assets/ln-b.png) 0 bottom repeat-x;
    margin: 0 auto;
    width: 90%;
    text-align: center;

    .item {
      flex: 1;
      text-align: center;
      line-height: 0.8rem;
      position: relative;
      white-space: nowrap;
      overflow: hidden;
      font-size: 0.16rem;
      text-overflow: ellipsis;

      .icon-vertical_line {
        position: absolute;
        right: 0;
        font-size: 0.3301rem;
      }

      .icon-xiala {
        font-size: 0.1598rem;
      }
    }
  }
}

.cinema-list {
  background: #fff;

  .item {
    padding: 0 0.3rem 0.26rem 0;
    margin: 0.3rem;
    background: #fff;
    position: relative;
    overflow: hidden;
    color: #333;
    background: url(../assets/ln-b.png) 0 bottom repeat-x;

    .cinema-item {
      align-items: center;
      display: block;

      .title {
        height: 0.46rem;
        line-height: 0.46rem;
        font-size: 0.32rem;
        color: #000;

        .price-block {
          padding-top: 0.18rem;
          padding-left: 0.06rem;

          .price {
            font-size: 0.36rem;
            color: #f03d37;
          }

          .q {
            font-size: 0.22rem;
            color: #f03d37;
            margin-left: 0.06rem;
          }
        }
      }

      .location {
        margin-top: 0.12rem;
        font-size: 0.26rem;
        color: #666;
        display: flex;
      }

      .label {
        height: 0.34rem;
        line-height: 0.34rem;
        margin-top: 0.08rem;
        margin-bottom: 0.08rem;
        overflow: hidden;
        font-size: 0;
        flex-shrink: 0;

        > div:not(:first-child) {
          margin-left: 0.1rem;
        }

        > div {
          position: relative;
          display: inline-block;
          padding: 0 0.06rem;
          height: 0.3rem;
          line-height: 0.3rem;
          border-radius: 0.04rem;
          font-size: 0.17rem;
        }

        .allowRefund,
        .endorse,
        .hallType {
          color: #589daf;
          border: 0.02rem solid #589daf;
        }

        .snack,
        .vipTag {
          color: #f90;
          border: 0.02rem solid #f90;
        }
      }

      .discount-block {
        color: #999;
        margin-bottom: 0.08rem;

        .card {
          width: 0.3rem;
          height: 0.28rem;
          position: relative;
          top: 0.06rem;
          display: inline-flex;

          img {
            width: 100%;
          }
        }

        .discount-label-text {
          margin-left: 0;
          font-size: 0.22rem;
          display: inline-block;
        }
      }
    }
  }
}
</style>